package com.ruoyi.common.utils.jkalman.jama.util;

/**
 * @ClassName Maths
 * @Description TODO
 * @Author jiayuan
 * @Date 2023/11/15 17:32
 * @Version 1.0
 */
public class Maths {
    public Maths() {
    }

    public static double hypot(double a, double b) {
        double r;
        if (Math.abs(a) > Math.abs(b)) {
            r = b / a;
            r = Math.abs(a) * Math.sqrt(1.0 + r * r);
        } else if (b != 0.0) {
            r = a / b;
            r = Math.abs(b) * Math.sqrt(1.0 + r * r);
        } else {
            r = 0.0;
        }

        return r;
    }
}